import { formatDate } from "date-fns"

export const DayList = [
    '全部',
    '今天',
    '2天',
    '3天',
    '4天',
    '5天',
    '6天',
    '一周后'
]

export function getActiveList(day, item) {
    if (day === 0) return true
    else {
        const TimeDistance = new Date(
            '2025-' + formatDate(new Date(item.birthday), 'MM-dd 0:0:0')
        ).getTime() -
            new Date(
                formatDate(new Date(), 'yyyy-MM-dd 0:0:0')
            ).getTime()
        if (day === 7) {
            return TimeDistance >= (day - 1) * 60 * 60 * 1000 * 24
        } else return TimeDistance === (day - 1) * 60 * 60 * 1000 * 24

    }
}
